#include "search_order.h"
#include "ui_search_order.h"
#include "mainwindow.h"
#include "main.h"
#include <cstring>
#include <string>
//订单查询模块
search_order::search_order(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::search_order)
{
    ui->setupUi(this);
}

search_order::~search_order()
{
    delete ui;
}

void search_order::on_pushButton_clicked()
{
    order_for_goods *item = NULL;
    item = o_first;
    std::string g_o = ui->lineEdit->text().toStdString();
    const char* g_oo = g_o.c_str();
    while(item){
        if(strcmp(item->order_ID, g_oo)){
            item = item->next;
        }else{
            ui->lineEdit_2->setText(QString(item->good_name));
            ui->lineEdit_3->setText(QString(item->good_price));
            ui->lineEdit_4->setText(QString(item->sent_addr));
            break;
        }
    }
    if(!item){
        ui->lineEdit_2->setText(QString("None"));
        ui->lineEdit_3->setText(QString("None"));
        ui->lineEdit_4->setText(QString("None"));
    }
}
